package com.zhongyu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhongyu.mapper.IReportMapper;
import com.zhongyu.pojo.Order;
import com.zhongyu.service.xsbIReportService;
import com.zhongyu.vo.OrderVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("iReportService")
public class xsbXsbIRportServiceImpl implements xsbIReportService {
    @Resource
    private IReportMapper iReportMapper;
    @Override
    public List ordersReport(OrderVo orderVo) {
        LambdaQueryWrapper<Order> wrapper= Wrappers.<Order>lambdaQuery();
        wrapper.ge(orderVo.getStartDate()!=null,Order::getCreateTime,orderVo.getStartDate())
                .le(orderVo.getEndDate()!=null,Order::getCreateTime,orderVo.getEndDate());
        return iReportMapper.ordersReport(wrapper);

    }
}
